package cn.springcloud.alibaba.sys.controller.v1;

import cn.springcloud.alibaba.core.base.Result;
import cn.springcloud.alibaba.sys.dto.SysRoleDTO;
import cn.springcloud.alibaba.sys.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/v1/role")
public class SysRoleController {

	@Autowired
	private SysRoleService sysRoleService;

	@GetMapping
	public Result<List<SysRoleDTO>> getSysMenus() {
		return sysRoleService.getSysRole();
	}

	@PostMapping
	public Result<String> addSysMenu() {
		return sysRoleService.addSysRole();
	}

	@PutMapping
	public Result<String> updateSysMenu() {
		return sysRoleService.updateSysRole();
	}

	@DeleteMapping
	public Result<String> deleteSysMenu() {
		return sysRoleService.deleteSysRole();
	}
}
